import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
// import print from 'vue3-print-nb'
import App from './App.vue'
// import './assets/public/print-lock.js'
// import { hiPrintPlugin } from 'vue-plugin-hiprint'
import router from './router'
import VuePluginHiPrint from 'vue-plugin-hiprint';
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
const app = createApp(App)
// app.use(hiPrintPlugin, '$pluginName'); // 使用插件
import zhCn from 'element-plus/es/locale/lang/zh-cn'


// hiPrintPlugin.disAutoConnect(); // 取消自动连接直接打印客户端

 app.use(VuePluginHiPrint)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(createPinia())
app.use(router)
app.use(ElementPlus, {
  locale: zhCn,
})

// 数据访问
import axios from 'axios'
// 添加JWT token信息
axios.defaults.headers.common["Authorization"] = "Bearer " + window.localStorage.getItem("token");


app.mount('#app')
